High performance real-time relational database system and methods for using same

ABSTRACT

A database system supporting persistent queries, comprising a client software application, a persistent query service, and a plurality of network-attached data sources. On receiving a request to create a persistent query from the client software application, the persistent query service: creates a query virtual table; parses the persistent query; creates a plurality of intermediate virtual tables; establishes listeners for the query virtual table; creates a plurality of data source virtual tables; causes the plurality of data source virtual tables to retrieve initial data from data sources; and propagates data via intermediate virtual tables to the persistent query virtual table. On detection of a data change in a data source, the associated data source virtual table causes the data change to propagate via intermediate virtual tables to the persistent query virtual table, and the client software application executes client code of at least one listener.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. provisional patent applicationSer. No. 61/682,756, titled “HIGH-PERFORMANCE REAL-TIME RELATIONALDATABASE SYSTEM AND METHODS FOR USING SAME”, filed on Aug. 13, 2012, theentire specification of which is incorporated hereby by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates to the field of database management systems, andparticularly to the field of real-time database systems supportingpersistent queries using virtual table structures.

2. Discussion of the State of the Art

Business reporting or enterprise reporting is a fundamental part ofidentifying the capabilities and performance metrics within anorganization to convert into knowledge to improve efficiency and overallperformance of people, systems and processes within the organization. Tosupport better business decision-making, businesses rely on largeamounts of information (for example, transactional log files,interaction log files, system configuration information, human resourceinformation, customer transaction data, path analytics, etc.) producedby management systems that provides managers with information aboutsales, inventories, and other data that would help in managing andimproving the enterprise.

With the dramatic expansion of information technology, and a desire forincreased competitiveness in corporations, there has been an enormousincrease in the capture of large datasets representing every facet ofbusiness processing, customer transactions, and other data to understandand improve how the business functions (often referred to as ‘BigData”). As such, computing power to produce unified reports (forexample, those that join different views of the enterprise in one place)has increased exponentially. This reporting process involves queryingdata sources with different logical models to produce a human readablereport. For example, in a customer service communication centerenvironment, a manager may query a human resources database, an employeeperformance database, a set of transactional logs, and real-time metricsto identify where resources may require improvement and furthertraining. Furthermore, a problem that exists in many cases is that largeorganizations still have data in legacy systems where moving to a morerobust, open-systems architecture is cost prohibitive. In otherorganizations, systems and data warehouses are developed as functionalsilos where every new system requires its own database and as a result,data follows a different schema and is often copied from system tosystem. In other situations, businesses have fundamentally differentdata sources that must remain separate (for example a communicationserver system and a customer experience database). As a result,businesses need to consolidate their disparate data while moving it fromplace to place, from one or more sources, and in different forms orformats. For example, a financial institution might have information ona customer in several departments and each department might have thatcustomer's information listed in a different format. The customerservice department might list the customer by name, whereas theaccounting department might list the customer by number. In order to usethe data to create a report from one or more data sources, the data mayneed to be bundled and consolidated into a uniform arrangement andstored in a database or data warehouse that may be used as the datasource for report creation. The function to consolidate the data istypically handled by an extract, transform, and load (ETL) procedure.Extracting is the process of reading data from one or more sourcedatabase. Transform is the process of converting the extracted data fromits previous form into the form it needs to be in so that it may beplaced into a target database where transformation occurs by using rulesor lookup tables or by combining the data with other data. Load is theprocess of writing the data into the target data warehouse. A user wouldthen use a special-purpose query language designed for managing data(for example, structured query language (SQL) known in the art) toidentify what data elements are required for a business report.

The problem with systems known in the art is that the ETL process takestime to extract, transform and load the required data from the one ormore data sources. The larger the dataset, the longer the process maytake. In some installations where large data sets are involvedprocessing ETL may be extremely slow, often taking hours or days. Inthese cases, costs are increased the ability to provide reports in areal-time or in a timely manner is often not possible. Furthermorereports may be inaccurate as data from the system has not yet beenwritten. For example, in a contact center environment, it is desired tomeasure performance in 15 minute time increments in order to react tosudden increases or decreases in interaction traffic. Since a contactcenter is typically made up of many data sources (for example, agentinformation, customer profile information, transaction information,historical contact information, etc.) from multiple data sources (forexample, private branch exchange (PBX) transaction information, routinginformation, configuration service information, etc.) the reports aretypically not available after the 15 minute interval and perhaps notavailable for many hours afterwards thus rendering the real-time reportinaccurate or unusable.

To remedy this situation, various techniques have been tried in the art,for example, a total in-memory database, but for a large application,such as in a high data throughput environment (for example, a largecontact center or financial institution), the amount of memory that isrequired is massive where even modern systems cannot feasiblyaccommodate the memory requirements, and thus become cost-ineffective.

What is needed is a highly responsive system and methods for providing areal-time database capable of handling persistent queries that are veryresponsive to data updates and that support persistent and readilyupdates aggregations of data so that analysis and reporting systems mayreport in smaller time increments (for example, 15 minute intervals),while allowing for reports to become available very soon, if notimmediately when a report is requested without a huge infrastructure.

SUMMARY OF THE INVENTION

Accordingly, the inventor has conceived and reduced to practice, in apreferred embodiment of the invention, a real-time database system thatsupports persistent queries, and various methods for using the same.

According to a preferred embodiment of the invention, a database systemsupporting persistent queries is disclosed, comprising a client softwareapplication operating on a computer comprising at least a listenercomprising client code to be executed when the listener is invoked, apersistent query service stored and operating on a network-attachedserver computer or locally on a client computer and adapted to receiveconnections and requests from the client software application, and aplurality of network-attached data sources. On receiving a request tocreate a persistent query from the client software application, thepersistent query service: creates a query virtual table corresponding tothe persistent query; parses the persistent query to create a treestructure representing a logical arrangement of a plurality of operatorsthat yield results required by the persistent query; creates a pluralityof intermediate virtual tables corresponding to the plurality ofoperators, wherein the step of creating an intermediate virtual tablefurther comprises establishing listeners associated with theintermediate virtual table to receive data change notifications;establishes listeners for the query virtual table to receive data changenotifications from a plurality of intermediate virtual tables; creates aplurality of data source virtual tables, each corresponding to aspecific data source required to fulfill the persistent query; causesthe plurality of data source virtual tables to retrieve initial datafrom the plurality of data sources; and propagates data via theplurality of intermediate virtual tables and their associated listenersto the persistent query virtual table. On detection of a data change ina data source, the associated data source virtual table invokes aplurality of corresponding methods of listeners of a plurality ofvirtual intermediate tables and propagates the data change via theplurality of intermediate virtual tables and their associated listenersto the persistent query virtual table, and the client softwareapplication executes the client code of at least one affected listener.

According to another preferred embodiment of the invention, a method forproviding persistent database queries is provided, the method comprisingthe steps of: (a) creating, via a software application executing on acomputer, a persistent query; wherein the step of creating thepersistent query further comprises establishing listeners with clientcode to receive notifications from the persistent query; (b) creating aquery virtual table corresponding to the persistent query; (c) parsingthe persistent query to create a tree structure representing a logicalarrangement of a plurality of operators that yield results required bythe persistent query; (d) creating a plurality of intermediate virtualtables corresponding to the plurality of operators; wherein the step ofcreating an intermediate virtual table further comprises establishinglisteners associated with the intermediate virtual table to receive datachange notifications; (e) establishing listeners for the query virtualtable to receive data change notifications from a plurality ofintermediate virtual tables; (f) creating a plurality of data sourcevirtual tables, each corresponding to a specific data source required tofulfill the persistent query; (g) retrieving, by the plurality of datasource virtual tables, initial data from the plurality of data sources;(h) invoking, by the plurality of data source virtual tables, row addedmethods of a plurality of intermediate virtual tables; (i) propagatingdata via the plurality of intermediate virtual tables and theirassociated listeners to the persistent query virtual table; (j) ondetection of a data change in a data source, invoking by the associateddata source virtual table of corresponding methods of listeners of aplurality of virtual intermediate tables; (k) propagating the datachange via the plurality of intermediate virtual tables and theirassociated listeners to the persistent query virtual table; and (1)executing the client code of each affected listener in the query virtualtable.

BRIEF DESCRIPTION OF THE DRAWING FIGURES

The accompanying drawings illustrate several embodiments of theinvention and, together with the description, serve to explain theprinciples of the invention according to the embodiments. One skilled inthe art will recognize that the particular embodiments illustrated inthe drawings are merely exemplary, and are not intended to limit thescope of the present invention.

FIG. 1 is a block diagram illustrating an exemplary hardwarearchitecture of a computing device used in an embodiment of theinvention.

FIG. 2 is a block diagram illustrating an exemplary logical architecturefor a client device, according to an embodiment of the invention.

FIG. 3 is a block diagram showing an exemplary architectural arrangementof clients, servers, and external services, according to an embodimentof the invention.

FIG. 4 is a block diagram of a conceptual architecture of a systemaccording to a preferred embodiment of the invention.

FIG. 5 is a diagram illustrating relationships between virtual tablesfor a first exemplary query, according to a preferred embodiment of theinvention.

FIG. 6 is a diagram illustrating relationships between virtual tablesfor a second exemplary query, according to a preferred embodiment of theinvention.

FIG. 7 is a process flow diagram illustrating a method for setting up adynamic real-time data query, according to a preferred embodiment of theinvention.

FIG. 8 is a process flow diagram illustrating a method for handlingchanges in source data within a dynamic real-time data query, accordingto a preferred embodiment of the invention.

DETAILED DESCRIPTION

The inventor has conceived, and reduced to practice, a real-timedatabase system that supports persistent queries, and various methodsfor using the same.

One or more different inventions may be described in the presentapplication. Further, for one or more of the inventions describedherein, numerous alternative embodiments may be described; it should beunderstood that these are presented for illustrative purposes only. Thedescribed embodiments are not intended to be limiting in any sense. Oneor more of the inventions may be widely applicable to numerousembodiments, as is readily apparent from the disclosure. In general,embodiments are described in sufficient detail to enable those skilledin the art to practice one or more of the inventions, and it is to beunderstood that other embodiments may be utilized and that structural,logical, software, electrical and other changes may be made withoutdeparting from the scope of the particular inventions. Accordingly,those skilled in the art will recognize that one or more of theinventions may be practiced with various modifications and alterations.Particular features of one or more of the inventions may be describedwith reference to one or more particular embodiments or figures thatform a part of the present disclosure, and in which are shown, by way ofillustration, specific embodiments of one or more of the inventions. Itshould be understood, however, that such features are not limited tousage in the one or more particular embodiments or figures withreference to which they are described. The present disclosure is neithera literal description of all embodiments of one or more of theinventions nor a listing of features of one or more of the inventionsthat must be present in all embodiments.

Headings of sections provided in this patent application and the titleof this patent application are for convenience only, and are not to betaken as limiting the disclosure in any way.

Devices that are in communication with each other need not be incontinuous communication with each other, unless expressly specifiedotherwise. In addition, devices that are in communication with eachother may communicate directly or indirectly through one or moreintermediaries, logical or physical.

A description of an embodiment with several components in communicationwith each other does not imply that all such components are required. Tothe contrary, a variety of optional components may be described toillustrate a wide variety of possible embodiments of one or more of theinventions and in order to more fully illustrate one or more aspects ofthe inventions. Similarly, although process steps, method steps,algorithms or the like may be described in a sequential order, suchprocesses, methods and algorithms may generally be configured to work inalternate orders, unless specifically stated to the contrary. In otherwords, any sequence or order of steps that may be described in thispatent application does not, in and of itself, indicate a requirementthat the steps be performed in that order. The steps of describedprocesses may be performed in any order practical. Further, some stepsmay be performed simultaneously despite being described or implied asoccurring non-simultaneously (e.g., because one step is described afterthe other step). Moreover, the illustration of a process by itsdepiction in a drawing does not imply that the illustrated process isexclusive of other variations and modifications thereto, does not implythat the illustrated process or any of its steps are necessary to one ormore of the invention(s), and does not imply that the illustratedprocess is preferred. Also, steps are generally described once perembodiment, but this does not mean they must occur once, or that theymay only occur once each time a process, method, or algorithm is carriedout or executed. Some steps may be omitted in some embodiments or someoccurrences, or some steps may be executed more than once in a givenembodiment or occurrence.

When a single device or article is described, it will be readilyapparent that more than one device or article may be used in place of asingle device or article. Similarly, where more than one device orarticle is described, it will be readily apparent that a single deviceor article may be used in place of the more than one device or article.

The functionality or the features of a device may be alternativelyembodied by one or more other devices that are not explicitly describedas having such functionality or features. Thus, other embodiments of oneor more of the inventions need not include the device itself.

Techniques and mechanisms described or referenced herein will sometimesbe described in singular form for clarity. However, it should be notedthat particular embodiments include multiple iterations of a techniqueor multiple instantiations of a mechanism unless noted otherwise.Process descriptions or blocks in figures should be understood asrepresenting modules, segments, or portions of code which include one ormore executable instructions for implementing specific logical functionsor steps in the process. Alternate implementations are included withinthe scope of embodiments of the present invention in which, for example,functions may be executed out of order from that shown or discussed,including substantially concurrently or in reverse order, depending onthe functionality involved, as would be understood by those havingordinary skill in the art.

DEFINITIONS

A “persistent query”, as used herein, is a query against one or moredata sources (such as relational or non-relational database systems,spreadsheets, real time event sources, flat data files, and the like),which is maintained in an active state upon its creation until it isexplicitly destroyed by the application that created it. Persistentqueries, according to the invention, are incrementally updated each timeone or more changes to an underlying data source occurs that affects atleast one data element used by the persistent query. Thus applications(even those other than the application that created a persistent query)may use the data within a persistent query's result set at any time,without re-executing the query as is commonly done in the art, whilebeing assured that the data is current as of the most recent incrementalchanges to the underlying data sources. Thus a typical use case ofpersistent queries is to support effectively real-time queries even inlarge systems that change automatically and substantially immediately inresponse to changes in one or more underlying data elements, without auser's or an application's having to re-run the query in its entirety.

“Extract, Transform and Load (ETL)”, as used herein, refers to a processthat migrates data from one database to another while, typically to formdatamarts or data warehouses, o to convert databases from one format ortype to another. The ETL function is made up of three steps. Extractionis the process of reading (extracting) data from a source database.“Transformation” is the process of converting the extracted data fromits initial form into a form it needs to be in so that it may be placedinto another database. Transformation occurs by using rules or lookuptables or by combining the data with other data. “Loading” is a processof writing the data into the target database.

“Structured query language (SQL)”, as used herein, refers to aspecial-purpose programming language designed for loading, changing,deleting, querying, and otherwise managing data in relational databasemanagement systems. It should be understood by one having ordinary skillin the art that SQL is one of many data querying language or protocolsknown in the art, any of which may be used with persistent queries asdescribed herein, without departing from the scope of the invention.

As used herein, a “virtual table” is an in-memory data table that iscreated and maintained as part of a persistent query, but that is notresident or included in any underlying data source (such as a relationaldatabase system). Some virtual tables, according to the invention, willactually store data in memory (and thus consume memory), where as othersdo not store data but simply act on data received from its data sourcesand send the results to other virtual tables that are configured asrecipients of the virtual table's data (that is, for some virtualtables, data simply “passes through” and is acted on as it does so,while in other virtual tables data is actually stored persistently;typically the virtual table from which a user of a persistent queryobtains results is of the latter type).

Hardware Architecture

Generally, the techniques disclosed herein may be implemented onhardware or a combination of software and hardware. For example, theymay be implemented in an operating system kernel, in a separate userprocess, in a library package bound into network applications, on aspecially constructed machine, on an application-specific integratedcircuit (ASIC), or on a network interface card.

Software/hardware hybrid implementations of at least some of theembodiments disclosed herein may be implemented on a programmablenetwork-resident machine (which should be understood to includeintermittently connected network-aware machines) selectively activatedor reconfigured by a computer program stored in memory. Such networkdevices may have multiple network interfaces that may be configured ordesigned to utilize different types of network communication protocols.A general architecture for some of these machines may be disclosedherein in order to illustrate one or more exemplary means by which agiven unit of functionality may be implemented. According to specificembodiments, at least some of the features or functionalities of thevarious embodiments disclosed herein may be implemented on one or moregeneral-purpose computers associated with one or more networks, such asfor example an end-user computer system, a client computer, a networkserver or other server system, a mobile computing device (e.g., tabletcomputing device, mobile phone, smartphone, laptop, and the like), aconsumer electronic device, a music player, or any other suitableelectronic device, router, switch, or the like, or any combinationthereof. In at least some embodiments, at least some of the features orfunctionalities of the various embodiments disclosed herein may beimplemented in one or more virtualized computing environments (e.g.,network computing clouds, virtual machines hosted on one or morephysical computing machines, or the like).

Referring now to FIG. 1, there is shown a block diagram depicting anexemplary computing device 100 suitable for implementing at least aportion of the features or functionalities disclosed herein. Computingdevice 100 may be, for example, any one of the computing machines listedin the previous paragraph, or indeed any other electronic device capableof executing software- or hardware-based instructions according to oneor more programs stored in memory. Computing device 100 may be adaptedto communicate with a plurality of other computing devices, such asclients or servers, over communications networks such as a wide areanetwork a metropolitan area network, a local area network, a wirelessnetwork, the Internet, or any other network, using known protocols forsuch communication, whether wireless or wired.

In one embodiment, computing device 100 includes one or more centralprocessing units (CPU) 102, one or more interfaces 110, and one or morebusses 106 (such as a peripheral component interconnect (PCI) bus). Whenacting under the control of appropriate software or firmware, CPU 102may be responsible for implementing specific functions associated withthe functions of a specifically configured computing device or machine.For example, in at least one embodiment, a computing device 100 may beconfigured or designed to function as a server system utilizing CPU 102,local memory 101 and/or remote memory 120, and interface(s) 110. In atleast one embodiment, CPU 102 may be caused to perform one or more ofthe different types of functions and/or operations under the control ofsoftware modules or components, which for example, may include anoperating system and any appropriate applications software, drivers, andthe like.

CPU 102 may include one or more processors 103 such as, for example, aprocessor from one of the Intel, ARM, Qualcomm, and AMD families ofmicroprocessors. In some embodiments, processors 103 may includespecially designed hardware such as application-specific integratedcircuits (ASICs), electrically erasable programmable read-only memories(EEPROMs), field-programmable gate arrays (FPGAs), and so forth, forcontrolling operations of computing device 100. In a specificembodiment, a local memory 101 (such as non-volatile random accessmemory (RAM) and/or read-only memory (ROM), including for example one ormore levels of cached memory) may also form part of CPU 102. However,there are many different ways in which memory may be coupled to system100. Memory 101 may be used for a variety of purposes such as, forexample, caching and/or storing data, programming instructions, and thelike.

As used herein, the term “processor” is not limited merely to thoseintegrated circuits referred to in the art as a processor, a mobileprocessor, or a microprocessor, but broadly refers to a microcontroller,a microcomputer, a programmable logic controller, anapplication-specific integrated circuit, and any other programmablecircuit.

In one embodiment, interfaces 110 are provided as network interfacecards (NICs). Generally, NICs control the sending and receiving of datapackets over a computer network; other types of interfaces 110 may forexample support other peripherals used with computing device 100. Amongthe interfaces that may be provided are Ethernet interfaces, frame relayinterfaces, cable interfaces, DSL interfaces, token ring interfaces,graphics interfaces, and the like. In addition, various types ofinterfaces may be provided such as, for example, universal serial bus(USB), Serial, Ethernet, Firewire™, PCI, parallel, radio frequency (RF),Bluetooth™ near-field communications (e.g., using near-field magnetics),802.11 (WiFi), frame relay, TCP/IP, ISDN, fast Ethernet interfaces,Gigabit Ethernet interfaces, asynchronous transfer mode (ATM)interfaces, high-speed serial interface (HSSI) interfaces, Point of Sale(POS) interfaces, fiber data distributed interfaces (FDDIs), and thelike. Generally, such interfaces 110 may include ports appropriate forcommunication with appropriate media. In some cases, they may alsoinclude an independent processor and, in some in stances, volatileand/or non-volatile memory (e.g., RAM).

Although the system shown in FIG. 1 illustrates one specificarchitecture for a computing device 100 for implementing one or more ofthe inventions described herein, it is by no means the only devicearchitecture on which at least a portion of the features and techniquesdescribed herein may be implemented. For example, architectures havingone or any number of processors 103 may be used, and such processors 103may be present in a single device or distributed among any number ofdevices. In one embodiment, a single processor 103 handlescommunications as well as routing computations, while in otherembodiments a separate dedicated communications processor may beprovided. In various embodiments, different types of features orfunctionalities may be implemented in a system according to theinvention that includes a client device (such as a tablet device orsmartphone running client software) and server systems (such as a serversystem described in more detail below).

Regardless of network device configuration, the system of the presentinvention may employ one or more memories or memory modules (such as,for example, remote memory block 120 and local memory 101) configured tostore data, program instructions for the general-purpose networkoperations, or other information relating to the functionality of theembodiments described herein (or any combinations of the above). Programinstructions may control execution of or comprise an operating systemand/or one or more applications, for example. Memory 120 or memories101, 120 may also be configured to store data structures, configurationdata, encryption data, historical system operations information, or anyother specific or generic non-program information described herein.

Because such information and program instructions may be employed toimplement one or more systems or methods described herein, at least somenetwork device embodiments may include nontransitory machine-readablestorage media, which, for example, may be configured or designed tostore program instructions, state information, and the like forperforming various operations described herein. Examples of suchnontransitory machine-readable storage media include, but are notlimited to, magnetic media such as hard disks, floppy disks, andmagnetic tape; optical media such as CD-ROM disks; magneto-optical mediasuch as optical disks, and hardware devices that are speciallyconfigured to store and perform program instructions, such as read-onlymemory devices (ROM), flash memory, solid state drives, memristormemory, random access memory (RAM), and the like. Examples of programinstructions include both object code, such as may be produced by acompiler, machine code, such as may be produced by an assembler or alinker, byte code, such as may be generated by for example a Java™compiler and may be executed using a Java virtual machine or equivalent,or files containing higher level code that may be executed by thecomputer using an interpreter (for example, scripts written in Python,Perl, Ruby, Groovy, or any other scripting language).

In some embodiments, systems according to the present invention may beimplemented on a standalone computing system. Referring now to FIG. 2,there is shown a block diagram depicting a typical exemplaryarchitecture of one or more embodiments or components thereof on astandalone computing system. Computing device 200 includes processors210 that may run software that carry out one or more functions orapplications of embodiments of the invention, such as for example aclient application 230. Processors 210 may carry out computinginstructions under control of an operating system 220 such as, forexample, a version of Microsoft's Windows™ operating system, Apple's MacOS/X or iOS operating systems, some variety of the Linux operatingsystem, Google's Android™ operating system, or the like. In many cases,one or more shared services 225 may be operable in system 200, and maybe useful for providing common services to client applications 230.Services 225 may for example be Windows™ services, user-space commonservices in a Linux environment, or any other type of common servicearchitecture used with operating system 210. Input devices 270 may be ofany type suitable for receiving user input, including for example akeyboard, touchscreen, microphone (for example, for voice input), mouse,touchpad, trackball, or any combination thereof. Output devices 260 maybe of any type suitable for providing output to one or more users,whether remote or local to system 200, and may include for example oneor more screens for visual output, speakers, printers, or anycombination thereof. Memory 240 may be random-access memory having anystructure and architecture known in the art, for use by processors 210,for example to run software. Storage devices 250 may be any magnetic,optical, mechanical, memristor, or electrical storage device for storageof data in digital form. Examples of storage devices 250 include flashmemory, magnetic hard drive, CD-ROM, and/or the like.

In some embodiments, systems of the present invention may be implementedon a distributed computing network, such as one having any number ofclients and/or servers. Referring now to FIG. 3, there is shown a blockdiagram depicting an exemplary architecture for implementing at least aportion of a system according to an embodiment of the invention on adistributed computing network. According to the embodiment, any numberof clients 330 may be provided. Each client 330 may run software forimplementing client-side portions of the present invention; clients maycomprise a system 200 such as that illustrated in FIG. 2. In addition,any number of servers 320 may be provided for handling requests receivedfrom one or more clients 330. Clients 330 and servers 320 maycommunicate with one another via one or more electronic networks 310,which may be in various embodiments any of the Internet, a wide areanetwork, a mobile telephony network, a wireless network (such as WiFi,Wimax, and so forth), or a local area network (or indeed any networktopology known in the art; the invention does not prefer any one networktopology over any other). Networks 310 may be implemented using anyknown network protocols, including for example wired and/or wirelessprotocols.

In addition, in some embodiments, servers 320 may call external services370 when needed to obtain additional information, or to refer toadditional data concerning a particular call. Communications withexternal services 370 may take place, for example, via one or morenetworks 310. In various embodiments, external services 370 may compriseweb-enabled services or functionality related to or installed on thehardware device itself. For example, in an embodiment where clientapplications 230 are implemented on a smartphone or other electronicdevice, client applications 230 may obtain information stored in aserver system 320 in the cloud or on an external service 370 deployed onone or more of a particular enterprise's or user's premises.

In some embodiments of the invention, clients 330 or servers 320 (orboth) may make use of one or more specialized services or appliancesthat may be deployed locally or remotely across one or more networks310. For example, one or more databases 340 may be used or referred toby one or more embodiments of the invention. It should be understood byone having ordinary skill in the art that databases 340 may be arrangedin a wide variety of architectures and using a wide variety of dataaccess and manipulation means. For example, in various embodiments oneor more databases 340 may comprise a relational database system using astructured query language (SQL), while others may comprise analternative data storage technology such as those referred to in the artas “NoSQL” (for example, Hadoop Cassandra, Google BigTable, and soforth). In some embodiments, variant database architectures such ascolumn-oriented databases, in-memory databases, clustered databases,distributed databases, or even flat file data repositories may be usedaccording to the invention. It will be appreciated by one havingordinary skill in the art that any combination of known or futuredatabase technologies may be used as appropriate, unless a specificdatabase technology or a specific arrangement of components is specifiedfor a particular embodiment herein. Moreover, it should be appreciatedthat the term “database” as used herein may refer to a physical databasemachine, a cluster of machines acting as a single database system, or alogical database within an overall database management system. Unless aspecific meaning is specified for a given use of the term “database”, itshould be construed to mean any of these senses of the word, all ofwhich are understood as a plain meaning of the term “database” by thosehaving ordinary skill in the art.

Similarly, most embodiments of the invention may make use of one or moresecurity systems 360 and configuration systems 350. Security andconfiguration management are common information technology (IT) and webfunctions, and some amount of each are generally associated with any ITor web systems. It should be understood by one having ordinary skill inthe art that any configuration or security subsystems known in the artnow or in the future may be used in conjunction with embodiments of theinvention without limitation, unless a specific security 360 orconfiguration system 350 or approach is specifically required by thedescription of any specific embodiment.

In various embodiments, functionality for implementing systems ormethods of the present invention may be distributed among any number ofclient and/or server components. For example, various software modulesmay be implemented for performing various functions in connection withthe present invention, and such modules may be variously implemented torun on server and/or client components.

Conceptual Architecture

FIG. 4 is a block diagram of a conceptual architecture of a system 400according to a preferred embodiment of the invention. According to theembodiment, client application 401 is a software application running ona computer that makes use of one or more persistent query services inorder to access a plurality of data sources 430, which may be comprisedof one or more relational database systems, a set of data stored inmemory of a computer, a flat file data store such as a file comprisingtransaction records, a server software running on a computer and adaptedto provide notifications of various types to requesting clients (forexample, a computer-telephony integration or CTI server, or aconfiguration server, each of which—and other server systems—provides astandards-based or proprietary application programming interface or APIthat allows other applications to receive data from the serversoftware), or any other software or hardware system accessible to clientapplication 401 on the same computing device or across a network. Clientapplication 401 functions by receiving a query, via application code402, that describes a desired set of data from one or more data sources430 for the purposes of data analysis, reporting or another function. Aquery may include for example data insert, query, update and delete,schema creation and modification, data access control, and otherdata-centric operations typical of database query languages such asStructure Query Language (SQL). Queries include a list of one or morecolumns representing the desired data to be included in a final result.A query may also include operators and functions for calculating valueson stored values, or on values passing through a virtual table as theyare received from an underlying data source, and queries typically allowthe use of expressions (for example, expressions that may produce eitherscalar values or tables consisting of columns and rows of data). In someembodiments, queries may be nested so that the results of one query maybe used as a data source in the containing query via a relationaloperator or an aggregation function. A nested query is also known as asubquery. Once a query (herein, referred to as an “active query”) isreceived by application code 402, a process of creating a virtual querytable (herein, referred to as ‘query table’) representing the output ofthe query is commenced by invocation of a create virtual table functionor operation 441. In order to populate a newly-created virtual tablecorresponding to the query, the query is sent to persistent query parser415 by send query function or operation 442 to persistent query parser415. persistent query parser 415 may in some embodiments be an integralpart of, or may be connected by a network to, client application 401. Itwill be appreciated by one having ordinary skills in the art that thereare various network protocols that may be used to allow softwareprocesses to communicate with each other. Persistent query parser 415parses the active query by first finding delimiters in the query. Basedon the position of the delimiters, persistent query parser 415 extractsvarious substrings of the elements delineated by the delimiters,creating a structured logical expression that encompasses the completelogical content of the original query in a form suitable for use bydatabase systems (this is analogous to how relational database systemsknown in the art parse a received SQL query), and compiles thedirectives to determine a resultant set of data and relationshipsbetween various data sources that the active query is requesting. Forexample, a query “SELECT name, address FROM CustomerData WHEREagent=‘smith’” submitted to application code 402 would result in thecreation of a virtual table with columns ‘name’ and ‘address’. The rowsof the persistent query table are the resulting data, based on the querydirectives. In this example, the resultant data would be customer nameand address that were handled by an agent named ‘smith’. Persistentquery parser 415 then creates a virtual table tree representing, forexample, the relationships, associations, data sources, etc. of thedesired data as per the active persistent query. Persistent query parser415 then creates one or more intermediate virtual tables 421 in the formof a virtual table tree, as well as one or more low level datasource-specific virtual tables 420 as the nodes of the table tree thatgather data from one or more data sources 430 (for example, aconfiguration service database, a flat file on a file system, a log filefrom a server, transaction information from a communication server,resource information from a relational database management system, orother data source). The persistent query virtual table and theintermediate virtual tables are created in a tree like structure withthe nodes being one or more data source-specific virtual tables 420. Ina preferred embodiment, intermediate virtual tables 421 a may connect toone or more data source-specific virtual table 420 each connecting,gathering and monitoring for data changes 444 that occur in data source430. For example data source-specific virtual table 420 may gatheremployee data from a human resource database data source 430. The datathat is monitored is specific to the data requested in the activepersistent query submitted to application code 402 (that is, theresultant data that is expected in the persistent query table) and onlyspecific data required by intermediate virtual tables 421 and/or thequery table is processed while other data is ignored. By gathering andmonitoring the data that is needed the invention benefits from aconsiderable increase in performance as the amount of data that isneeded for a persistent query is generally much less in quantity thanall the data that is collected by RDBMS systems in typical systems knownin the art. In addition to data fields created by persistent queryparser 415 for each virtual table, persistent query parser 415 alsocreates one or more methods to perform actions on the data, datasources, or some other object and to trigger notifications to parenttables. For example, a data source-specific virtual table 420 creates alistener for the data source. Based on the characteristics of the activequery, the listener gathers and monitors only data necessary to satisfythe active query (for example, the items in the SQL “WHERE clause”). Forexample, “SELECT name, address FROM CustomerData WHERE AgentID=‘1234’”,a data source-specific virtual table 421 a connected to a table, forexample “CustomerData” in data source 430. Data that would be passed upthe virtual tree would be records having a field “AgentID” with a valueof ‘1234’. Persistent query parser 415 would then set up all additionallisteners to each virtual table so that when a data change happens indata source 430, only affected elements propagate up the tree (bysequential calls to listeners of interim virtual tables) until they getto the original active persistent query on client application 401, atwhich point any updates are passed to the client. In a preferredembodiment, a persistent query system 400 may include, but not limitedto, SQL operators in Table 1.

TABLE 1 Example operators and their functions Operators Function SELECTselects data from one or more database tables and/or views INSERT INTOfacilitates the process of inserting data into a table WHERE works inconjunction with other SQL clauses like SELECT, INSERT and UPDATE tospecify a search condition for these statements. DISTINCT works inconjunction with the SQL SELECT clause and selects only distinct(unique) data from a database table(s) UPDATE serves to update data indatabase table DELETE used to delete data from a database table TRUNCATEdeletes all rows from a database table TABLE ORDER BY defines in whatorder to return a data set retrieved with a SQL SELECT statement.Aggregate function used to sum, count, get the average, get the such asSUM, minimum and get the maximum values from a AVG, MIN, etc. column orfrom a sub-set of column values GROUP BY used along with the SQLaggregate functions and specifies the groups where selected rows areplaced HAVING provides a search condition for a group or aggregate ANDand OR used together with the SQL WHERE clause to join two or moresearch conditions specified in the WHERE clause JOIN selects data fromtwo or more tables tied together by matching table columns UNION mergesthe results of two or more SELECT SQL queries into one result set

In another embodiment, a proprietary or open source query language maybe used for managing data, linking, aggregation, projections, filters,macros, compositional syntax, establishing data types and functions, andcreating persistent queries in a persistent query system 400.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS

FIG. 5 is a diagram illustrating relationships between virtual tablesfor a first exemplary persistent query, according to a preferredembodiment of the invention. While exemplary query 500 is based on acommon contact center-related use case, it should be understood thatquery 500 (and, for that matter, query 600 described below) are merelyexemplary, and that queries created and used according to the presentinvention could be from any subject domain without departing from thescope of the invention. Exemplary query 500 is a virtual tree diagramoutlining a query virtual table 441, a set of intermediate tables 421,and a set of data source specific virtual tables 420 for a sample query(herein, referred to as “sample query”) that produces a table with onerow per agent. Each row in the table set will have a person DBID of anagent and a list of agent group names of which the agent is a member, ina customer service communication environment. That is, a query that maybe expressed in SQL as “SELECT p.personDbid AS personDbid, list(ag.agentGroupName) AS group List FROM Person p INNER JOINAgentGroupToPerson agp ON p.personDbid=agp.personDbid INNER JOINAgentGroup ag ON agp.agentGroupDbid=ag.agentGroupDbid WHERE p.is Agent=2GROUP BY p.personDbid”. Person table 510 is a data source-specificvirtual table 420 that stores data, consumes memory, and has one or morerecords of persons within, for example, a customer service organization.For example, person virtual table 510 holds one thousand records of thenames of the employees employed by the customer service communicationcenter organization with details on their job function. The virtualtable has an alias of “p” and may be referenced by this letter for querypurposes. Agent group table 512 is another data source-specific virtualtable 420 that stores data and consumes memory that has one or morerecords of agent groups within a customer service organization. Forexample, agent group virtual table 512 holds fifty records of the namesof the agent groups based on group function (for example, billinggroup). Agent group to person table 511 is another data source-specificvirtual table 420 that stores data, consumes memory, and has a one ormore records of a list of persons and the agent groups to which eachperson belongs. For example, five hundred records of agents and theagent group ID to which they belong. Filter table 520 is a virtual tablethat manipulates data from person table 510 by applying a filter to thedata to inner join table 530. For example, filter table 520 onlyrequires the records from person virtual table 510 where field IsAgent=2(that is, all records of persons who are agents). Of course, it would beunderstood by one having ordinary skill in the art that any logicalexpression may be used to filter data (for example, in a tax relatedtable there may be a filter where a field t.SSN starts with 215). Innerjoin table 530 manipulates data when there is a match between filteredresults of person table 520 (that is, where the person is an agent) andagent group person table 511 and combines the data together. Forexample, when the DBID of the person from the filtered results fromperson table 510 are compared to the person DBIDs of agent group toperson table 511, a virtual table of agents and each agent group towhich they belong is created. Inner join table 531 manipulates data whenthere is a match between data from inner join table 530 and agent grouptable 512. For example, a table is created with persons and a name ofthe agent groups to which they belong, when agent group DBID record fromthe table created by inner join table 530 matches group DBID from agentgroup table 512. Projection table 540 is a table that stores data,consumes memory, and creates an alias for required data, based on thesample query. For example, personDBID from person table 510 may bereferenced as p1 and agent group name from agent group table 512 may bereferenced as p2 for the purpose of, for example, convenience. Group bytable 550 aggregates (that is, consolidates and calculates) columnvalues from projection table 540 into a single record value. Forexample, one row per agent with each row in the result having the personDBID and a list of agent group names that agent is a member of.Projection table 541 is a table that stores data, consumes memory, andcreates an alias for required data, based on the sample query. Forexample, g1 from group by table 550 may be referenced as personDbid anda list of agent group names referred to as g2 may be referred to asgroupList for the purpose of, for example, labeling and readability.

FIG. 6 is a diagram illustrating relationships between virtual tablesfor a second exemplary persistent query, according to a preferredembodiment of the invention. Exemplary query 600 (again, query 600 isintended as an example of a persistent query according to the invention,but it should be understood that the invention is in no way limited toqueries having to do with contact centers or any other subject domain)is a virtual tree diagram outlining a query virtual table 441, a set ofintermediate tables 421, and a data source specific virtual table 420for a sample query (herein, referred to as “sample query”) that producesa table of a basic workforce management (WFM) report with handle time(time spent on a call) and work time (time spent in after call work(ACW) or previewing an outbound call) for agents in a customer servicecommunication center environment. That is, a query that may be expressedin SQL as “SELECT t.target AS target, SUM(CASE WHEN t.state=‘Handled’THEN t.duration ELSE 0 END) AS handleTime, SUM(CASE WHEN t.state=‘ACW’OR t.state=‘Preview’ THEN t.duration ELSE 0 END) AS workTime FROMTargetState t GROUP BY t.target”. Target state table 610 is an infinitevirtual table that generates rows but does not store them from datasource 430 (for example, a transactional event log from a communicationsserver). Target state table 610 may generate a row each time anotification is received when a transactional event occurs in datasource 430. The infinite nature of the table is due to the continuouscreation of data rows while the sample query is active. Projection table620 is a virtual table that manipulates data from target state table610. In this example, if field “state” in target state table 610 has avalue of ‘Handled’, the value of data field “duration” is stored in p1otherwise if field “state” in target state table 610 has a value of‘ACW’ or ‘Preview’, the value of data field “duration” is stored in p2.In this example, a value of ‘Handled’ refers to a transaction that washandled by an agent and ‘duration’ holds an amount of time that saidagent spent handling the transaction. A value ‘ACW’ refers to atransaction that relates to after call work for an agent with durationequal to the value in the data field ‘duration’. A value of ‘Preview’refers to an agent that spent time previewing information for anoutbound call. The time said agent spent on previewing the outbound callis that value stored in the field ‘duration’. Group by table 630aggregates column values from projection table 620 into a single recordvalue. For example, for each agent total handle time is calculated bysumming p1 values from projection table 620 and calculating total worktime by summing p2 values from projection table 620. Projection table640 is a table that stores data, consumes memory, and creates an aliasfor the sample query. For example, g1 from group by table 630 may bereferenced as handleTime representing the handle time for the agent.Additionally, g2 may be referenced as workTime representing the totalwork time for agents in target state table 610 for the purpose of, forexample, labeling and readability. Example persistent query 600continues to produce data in the query table as long as the sample queryremains active. This is an improvement over systems known in the art inthat only the data that is needed is filtered and passed up the virtualtable tree to produce the required table of results. This makes itfeasible when processing large data sets particularly in real-timesystems to provide highly-responsive performance even when frequentincremental changes are made to one or more underlying data sources. Inparticular, the invention makes it unnecessary for a query to beexecuted fully to refresh a result set each time a change occurs in anunderlying data source, as is commonly done in the art today; ratherthan executing a complex query that may comprise numerous logicaloperations, data aggregations, and computations each time underlyingdata changes occur, according to the invention it is only necessary toupdate those elements of a persistent query that are affected by anyspecific changes to underlying data sources, while leaving all otherelements in a result set unchanged.

FIG. 7 is a process flow diagram illustrating a method for setting up adynamic persistent real-time data query, according to a preferredembodiment of the invention. In step 701, client application 401 createsa new query. In step 702, create virtual table 441 creates a virtualtable with a structure that represents the desired data (for example, aset of columns for each data element that is desired); at this point, nodata exists in the created virtual table. The query is submitted viaapplication code 402 to LiveSQ parser 415 in step 703. The query isparsed and a tree structure representing the intermediate virtual tablesthat are required for the query is created. Persistent query parser 415identifies which data sources are required for the query and a datasource specific virtual table 420 is created for each data source (forexample, a RDBMS, a configuration service database, a transactional logfile, a flat file, or some other repository of data) in step 705. Datasource specific virtual tables are responsible for monitoring one ormore data source 430 to identify when new data is available that may beneeded from the query in step 701. In step 706, persistent query parser415 creates the intermediate tables required to combine, process andmove data up the tree to the persistent query virtual table created instep 702. In some embodiments, virtual tables may generate output theconsole when an event occurs (for example, when a new row appears). Inanother embodiment, an optimization process may decide to change thetable structure dynamically to an equivalent but faster version. Whileclient application 401 maintains the persistent query in step 701active, the query virtual table 441, intermediate virtual tables 421,and data specific virtual tables 420 stay active and monitor the childtables and/or data sources accordingly. In step 707, data sourcespecific virtual table 420 receives initial data from data source 430.The data that data source specific virtual table 420 receives isspecific to what is required for the persistent query from step 701. Instep 708, data source specific virtual table 420 invokes one or moremethods to perform actions on the data, data sources, or some otherobject (for example, a listener method to identify when a row has beenadded to an intermediate virtual table 421, a data source specificvirtual table 420, and/or to a data source 430, a listener object). Insome embodiments, intermediate virtual table 421 a may change anincoming row-added into a row-changed or some other notification. Inanother embodiment, intermediate virtual table 421 b may also hideincoming notifications. In another embodiment, intermediate virtualtable 421 c will let the notification pass through but may change thedata (for example, the query in step 701 may require data to be combinedwith other data sources or calculated as an average, or some otherchange that is required). In step 709, the data propagates up thevirtual tree structure and is added to intermediate virtual table 421 aas necessary. In some embodiments, an intermediate virtual table 421,data source specific virtual table 420, or other virtual table in thevirtual table tree structure may only receive events and not store data.In another embodiments, an intermediate virtual table 421, data sourcespecific virtual table 420, or other virtual table in the virtual tabletree structure, data may pass through and apply joins (for example, toquery data from two or more data specific virtual table 420,intermediate virtual tables 421, or other virtual tables in the treestructure based on a relationship between certain columns in thesetables). In another embodiment, an intermediate virtual table 421, datasource specific virtual table 420, or other virtual table in the virtualtable tree structure, data may be kept in memory for future processingby other methods or to be used by intermediate virtual tables 421, orfor some other purpose. In step 709, results propagate up to persistentquery virtual table 441 created in step 702 representing the query fromstep 701. In step 710, client application 401 may use the resulting datafor aggregation or calculations. While the query from step 701 remainsactive, persistent query virtual table 441 created in step 702 willcontinue to be updated as new data arrives in data source specificvirtual table 420 and or/intermediate virtual tables 421.

In some embodiments of the invention, frequently reused virtual tablesmay be maintained even when all current persistent queries that use themhave been deleted by the applications that created them, in order tofurther improve system performance. In such embodiments, when a newpersistent query is created by an application, any virtual tablesrequired that have been maintained can be immediately used withoutrunning any queries against underlying data sources (since thestill-maintained virtual tables will be populated by data that reflectsthat latest changes to any underlying data sources), thus enabling rapidcreation and execution of new persistent queries.

FIG. 8 is a process flow diagram illustrating a method for handlingchanges in source data within a persistent real-time data query,according to a preferred embodiment of the invention. In step 801, datasource specific virtual table 420 receives a notification that there isan event with respect to data data in data source 430. In this example,data events will be accepted or ignored based on the requirements of apersistent query submitted via client application 401 (herein, referredto as an “active query” or a “persistent query”). For example, one ormore rows have been added, and/or one or more rows have changed, and/orone or more rows have been deleted or a combination of these. Eventnotifications from data source 430 may depend on the specific datasource, for example, a data source 430 that is a configuration service,or another type of data source may provide notification when changesoccur. A data source 430 that is a telephony server or another type datasource may require that data source-specific virtual table 420 registerfor object notification within data source 430 so that it may listen tofor changes. In another embodiment, data source 430 may be an RDBMSdatabase (for example, postgres, or another data base management systemknown in the art) that provides notification triggers to notify datasource-specific virtual table 420 with notifications that data may havechanged (for example, row added, changed, or deleted). For a data source430 that does not support notification triggers (for example, a lowfunctionality database, a flat file, or spreadsheet), datasource-specific virtual table 420, or a manual configuration, may invokea method to use an internal database trigger or file function to writeto a log whenever changes (for example row added, changed, or deleted)occur. The log may be periodically checked by data source-specificvirtual table 420 to retrieve necessary data for the active query. Instep 802, when a data change that is required for the active query, datasource-specific virtual table 420 notifies the parent intermediatevirtual table 421 c that data has changed (for example, a row has beenadded). In step 803, as data propagate up the virtual table tree createsby persistent query parser 415, parent virtual table intermediatevirtual table 421 b may use the data (for example to join to another setof data from a different source for aggregation, to calculate averagesor some other value using the data, etc.). In step 804, intermediatevirtual table 421 b then notifies the parent intermediate virtual table421 c that data has changed by firing the appropriate event and so on topropagate the change up the virtual table stack until in step 805, thequery virtual table 441 listener methods are invoked and query virtualtable 441 is updated with data that represents the output of the query.In step 806, client application code residing in listener is executedand data is available to client application 401.

The skilled person will be aware of a range of possible modifications ofthe various embodiments described above. Accordingly, the presentinvention is defined by the claims and their equivalents.

What is claimed is:
 1. A database system supporting persistent queries,the system comprising: a client software application operating on acomputer comprising at least a listener comprising client code to beexecuted when the listener is invoked; a persistent query service storedand operating on a network-attached computer adapted to receiveconnections and requests from the client software application; and aplurality of network-attached data sources; wherein, on receiving arequest to create a persistent query from the client softwareapplication, the persistent query service: creates a query virtual tablecorresponding to the persistent query; parses the persistent query tocreate a tree structure representing a logical arrangement of aplurality of operators that yield results required by the persistentquery; creates a plurality of intermediate virtual tables correspondingto the plurality of operators, wherein the step of creating anintermediate virtual table further comprises establishing listenersassociated with the intermediate virtual table to receive data changenotifications; establishes listeners for the query virtual table toreceive data change notifications from a plurality of intermediatevirtual tables; creates a plurality of data source virtual tables, eachcorresponding to a specific data source required to fulfill thepersistent query; causes the plurality of data source virtual tables toretrieve initial data from the plurality of data sources; and propagatesdata via the plurality of intermediate virtual tables and theirassociated listeners to the persistent query virtual table; and wherein,on detection of a data change in a data source, the associated datasource virtual table invokes a plurality of corresponding methods oflisteners of a plurality of virtual intermediate tables and propagatesthe data change via the plurality of intermediate virtual tables andtheir associated listeners to the persistent query virtual table, andthe client software application executes the client code of at least oneaffected listener.
 2. A method for creating and using persistent queriesin a database system, the method comprising the steps of: (a) creating,via a software application executing on a computer, a persistent query;wherein the step of creating the persistent query further comprisesestablishing listeners with client code to receive notifications fromthe persistent query; (b) creating a query virtual table correspondingto the persistent query; (c) parsing the persistent query to create atree structure representing a logical arrangement of a plurality ofoperators that yield results required by the persistent query; (d)creating a plurality of intermediate virtual tables corresponding to theplurality of operators; wherein the step of creating an intermediatevirtual table further comprises establishing listeners associated withthe intermediate virtual table to receive data change notifications; (e)establishing listeners for the query virtual table to receive datachange notifications from a plurality of intermediate virtual tables;(f) creating a plurality of data source virtual tables, eachcorresponding to a specific data source required to fulfill thepersistent query; (g) retrieving, by the plurality of data sourcevirtual tables, initial data from the plurality of data sources; (h)invoking, by the plurality of data source virtual tables, row addedmethods of a plurality of intermediate virtual tables; (i) propagatingdata via the plurality of intermediate virtual tables and theirassociated listeners to the persistent query virtual table; (j) ondetection of a data change in a data source, invoking by the associateddata source virtual table of corresponding methods of listeners of aplurality of virtual intermediate tables; (k) propagating the datachange via the plurality of intermediate virtual tables and theirassociated listeners to the persistent query virtual table; and (l)executing the client code of each affected listener in the query virtualtable.